import request from '@/utils/request'

const api_name = '/edu/teacher'

//  后台url:/edu/teacher
export default {

    // 分页查询带模糊  @PostMapping("/getTeacherByLikePage/{current}/{size}")
    getPageList(current,size,teacherQuery) {
        return request({        // 异步的格式
            url: `${api_name}/getTeacherByLikePage/${current}/${size}`,
            method: 'post',
            data: teacherQuery
        })
    },

    // 删除讲师   @DeleteMapping("/removeTeacherById/{id}")
    removeTeacherById(id){
        return request ({
            url: `${api_name}/removeTeacherById/${id}`,
            method: 'delete'
        })
    },
    // 添加讲师  @PostMapping("/saveTeacher")
    saveTeacher(teacher){
        return request ({
            url: `${api_name}/saveTeacher`,
            method: 'post',
            data: teacher
        })
    },
    // 数据回显  /@GetMapping("/getTeacherById/{id}")
    getTeacherById(id){
        return request ({
            url: `${api_name}/getTeacherById/${id}`,
            method: 'get'
        })
    },
    // 更新讲师 @PostMapping("/updateTeacher")  参数(@RequestBody EduTeacher eduTeacher)
    updateTeacher(teacher){
        return request ({
            url: `${api_name}/updateTeacher`,
            method: 'post',
            data: teacher
        })
    },
    getList() {
        return request({
            url: `${api_name}/getAllTeacher`,
            method: 'get'
        })
    }
}
